home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / sntimclc / form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-08  |  16.2 KB  |  471 lines

  1. VERSION 5.00
  2. Object = "{4061E361-3C46-11D2-AE66-D8A64094D131}#1.0#0"; "SNAILTIMECALC.DLL"
  3. Begin VB.Form Form1 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Snail CalcDate Demo"
  6.    ClientHeight    =   3525
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   6840
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    ScaleHeight     =   3525
  13.    ScaleWidth      =   6840
  14.    StartUpPosition =   3  'Windows Default
  15.    Begin VB.CommandButton cmdTimeMeth1 
  16.       Caption         =   "Time Methods"
  17.       Height          =   375
  18.       Left            =   1440
  19.       TabIndex        =   26
  20.       Top             =   120
  21.       Width           =   1215
  22.    End
  23.    Begin VB.CommandButton cmdDateMeth1 
  24.       Caption         =   "Date Methods"
  25.       Height          =   375
  26.       Left            =   120
  27.       TabIndex        =   24
  28.       Top             =   120
  29.       Width           =   1215
  30.    End
  31.    Begin VB.PictureBox picDateMeth1 
  32.       Height          =   2775
  33.       Left            =   120
  34.       ScaleHeight     =   2715
  35.       ScaleWidth      =   6555
  36.       TabIndex        =   0
  37.       Top             =   600
  38.       Width           =   6615
  39.       Begin VB.Frame fra_DatePlusDays 
  40.          Caption         =   "Method DatePlusDays"
  41.          Height          =   735
  42.          Left            =   120
  43.          TabIndex        =   16
  44.          Top             =   120
  45.          Width           =   6255
  46.          Begin VB.TextBox txtDateForDatePlusDays 
  47.             Height          =   285
  48.             Left            =   840
  49.             TabIndex        =   20
  50.             Text            =   "Text1"
  51.             Top             =   240
  52.             Width           =   855
  53.          End
  54.          Begin VB.TextBox txtDaysForDatePlusDays 
  55.             Height          =   285
  56.             Left            =   2400
  57.             TabIndex        =   19
  58.             Text            =   "Text1"
  59.             Top             =   240
  60.             Width           =   630
  61.          End
  62.          Begin VB.CommandButton cmdDatePlusDays 
  63.             Caption         =   "Do"
  64.             Height          =   375
  65.             Left            =   3480
  66.             TabIndex        =   18
  67.             Top             =   240
  68.             Width           =   495
  69.          End
  70.          Begin VB.TextBox txtResultDateForDatePlusDays 
  71.             Height          =   285
  72.             Left            =   4680
  73.             TabIndex        =   17
  74.             Text            =   "Text1"
  75.             Top             =   240
  76.             Width           =   855
  77.          End
  78.          Begin VB.Label Label1 
  79.             Caption         =   "Date:"
  80.             Height          =   255
  81.             Left            =   240
  82.             TabIndex        =   23
  83.             Top             =   240
  84.             Width           =   495
  85.          End
  86.          Begin VB.Label Label2 
  87.             Caption         =   "Days:"
  88.             Height          =   255
  89.             Left            =   1800
  90.             TabIndex        =   22
  91.             Top             =   240
  92.             Width           =   495
  93.          End
  94.          Begin VB.Label Label3 
  95.             Caption         =   "Result:"
  96.             Height          =   255
  97.             Left            =   4080
  98.             TabIndex        =   21
  99.             Top             =   240
  100.             Width           =   615
  101.          End
  102.       End
  103.       Begin VB.Frame fra_DaysBetweenDates 
  104.          Caption         =   "Method DaysBetweenDates"
  105.          Height          =   735
  106.          Left            =   120
  107.          TabIndex        =   8
  108.          Top             =   960
  109.          Width           =   6255
  110.          Begin VB.TextBox txtDateForDaysBetweenDays1 
  111.             Height          =   285
  112.             Left            =   840
  113.             TabIndex        =   12
  114.             Text            =   "Text1"
  115.             Top             =   240
  116.             Width           =   855
  117.          End
  118.          Begin VB.TextBox txtDateForDaysBetweenDays2 
  119.             Height          =   285
  120.             Left            =   2400
  121.             TabIndex        =   11
  122.             Text            =   "Text1"
  123.             Top             =   240
  124.             Width           =   855
  125.          End
  126.          Begin VB.TextBox txtResultDays 
  127.             Height          =   285
  128.             Left            =   4680
  129.             TabIndex        =   10
  130.             Text            =   "Text1"
  131.             Top             =   240
  132.             Width           =   735
  133.          End
  134.          Begin VB.CommandButton cmdDaysBetweenDates 
  135.             Caption         =   "Do"
  136.             Height          =   375
  137.             Left            =   3480
  138.             TabIndex        =   9
  139.             Top             =   240
  140.             Width           =   495
  141.          End
  142.          Begin VB.Label Label4 
  143.             Caption         =   "Date1:"
  144.             Height          =   255
  145.             Left            =   240
  146.             TabIndex        =   15
  147.             Top             =   240
  148.             Width           =   615
  149.          End
  150.          Begin VB.Label Label5 
  151.             Caption         =   "Date 2:"
  152.             Height          =   255
  153.             Left            =   1800
  154.             TabIndex        =   14
  155.             Top             =   240
  156.             Width           =   615
  157.          End
  158.          Begin VB.Label Label6 
  159.             Caption         =   "Result:"
  160.             Height          =   255
  161.             Left            =   4080
  162.             TabIndex        =   13
  163.             Top             =   240
  164.             Width           =   615
  165.          End
  166.       End
  167.       Begin VB.Frame fra_DayOfWeek 
  168.          Caption         =   "Method DayOfWeek"
  169.          Height          =   735
  170.          Left            =   120
  171.          TabIndex        =   1
  172.          Top             =   1800
  173.          Width           =   6255
  174.          Begin VB.CommandButton cmdDayOfWeek 
  175.             Caption         =   "Do"
  176.             Height          =   375
  177.             Left            =   3480
  178.             TabIndex        =   5
  179.             Top             =   240
  180.             Width           =   495
  181.          End
  182.          Begin VB.TextBox txtDayOfWeekNumber 
  183.             Height          =   285
  184.             Left            =   4680
  185.             TabIndex        =   4
  186.             Text            =   "Text1"
  187.             Top             =   240
  188.             Width           =   375
  189.          End
  190.          Begin VB.TextBox txtDateForDayOfWeek 
  191.             Height          =   285
  192.             Left            =   840
  193.             TabIndex        =   3
  194.             Text            =   "Text1"
  195.             Top             =   240
  196.             Width           =   855
  197.          End
  198.          Begin VB.TextBox txtDayOfWeekVerbose 
  199.             Height          =   285
  200.             Left            =   5160
  201.             TabIndex        =   2
  202.             Text            =   "Text1"
  203.             Top             =   240
  204.             Width           =   975
  205.          End
  206.          Begin VB.Label Label7 
  207.             Caption         =   "Result:"
  208.             Height          =   255
  209.             Left            =   4080
  210.             TabIndex        =   7
  211.             Top             =   240
  212.             Width           =   615
  213.          End
  214.          Begin VB.Label Label8 
  215.             Caption         =   "Date:"
  216.             Height          =   255
  217.             Left            =   120
  218.             TabIndex        =   6
  219.             Top             =   240
  220.             Width           =   615
  221.          End
  222.       End
  223.    End
  224.    Begin VB.PictureBox picTimeMeth1 
  225.       Height          =   2775
  226.       Left            =   120
  227.       ScaleHeight     =   2715
  228.       ScaleWidth      =   6555
  229.       TabIndex        =   25
  230.       Top             =   600
  231.       Width           =   6615
  232.       Begin VB.Frame fraTimeMinusTime 
  233.          Caption         =   "Method TimeMinusTime"
  234.          Height          =   735
  235.          Left            =   120
  236.          TabIndex        =   35
  237.          Top             =   960
  238.          Width           =   6255
  239.          Begin VB.TextBox txtTimeForTimeMinusTime1 
  240.             Height          =   285
  241.             Left            =   720
  242.             TabIndex        =   39
  243.             Text            =   "Text1"
  244.             Top             =   240
  245.             Width           =   855
  246.          End
  247.          Begin VB.TextBox txtTimeForTimeMinusTime2 
  248.             Height          =   285
  249.             Left            =   2400
  250.             TabIndex        =   38
  251.             Text            =   "Text1"
  252.             Top             =   240
  253.             Width           =   855
  254.          End
  255.          Begin VB.TextBox txtTimeMinusTimeResult 
  256.             Height          =   285
  257.             Left            =   4680
  258.             TabIndex        =   37
  259.             Text            =   "Text1"
  260.             Top             =   240
  261.             Width           =   735
  262.          End
  263.          Begin VB.CommandButton cmdTimeMinusTime 
  264.             Caption         =   "Do"
  265.             Height          =   375
  266.             Left            =   3480
  267.             TabIndex        =   36
  268.             Top             =   240
  269.             Width           =   495
  270.          End
  271.          Begin VB.Label Label14 
  272.             Caption         =   "Time 1:"
  273.             Height          =   255
  274.             Left            =   120
  275.             TabIndex        =   42
  276.             Top             =   240
  277.             Width           =   615
  278.          End
  279.          Begin VB.Label Label13 
  280.             Caption         =   "Time 2:"
  281.             Height          =   255
  282.             Left            =   1800
  283.             TabIndex        =   41
  284.             Top             =   240
  285.             Width           =   615
  286.          End
  287.          Begin VB.Label Label12 
  288.             Caption         =   "Result:"
  289.             Height          =   255
  290.             Left            =   4080
  291.             TabIndex        =   40
  292.             Top             =   240
  293.             Width           =   615
  294.          End
  295.       End
  296.       Begin VB.Frame fraTimePlusTime 
  297.          Caption         =   "Method TimePlusTime"
  298.          Height          =   735
  299.          Left            =   120
  300.          TabIndex        =   27
  301.          Top             =   120
  302.          Width           =   6255
  303.          Begin VB.CommandButton cmdTimePlusTime 
  304.             Caption         =   "Do"
  305.             Height          =   375
  306.             Left            =   3480
  307.             TabIndex        =   31
  308.             Top             =   240
  309.             Width           =   495
  310.          End
  311.          Begin VB.TextBox txtTimePlusTimeResult 
  312.             Height          =   285
  313.             Left            =   4680
  314.             TabIndex        =   30
  315.             Text            =   "Text1"
  316.             Top             =   240
  317.             Width           =   735
  318.          End
  319.          Begin VB.TextBox txtTimeForTimePlusTime2 
  320.             Height          =   285
  321.             Left            =   2400
  322.             TabIndex        =   29
  323.             Text            =   "Text1"
  324.             Top             =   240
  325.             Width           =   855
  326.          End
  327.          Begin VB.TextBox txtTimeForTimePlusTime1 
  328.             Height          =   285
  329.             Left            =   720
  330.             TabIndex        =   28
  331.             Text            =   "Text1"
  332.             Top             =   240
  333.             Width           =   855
  334.          End
  335.          Begin VB.Label Label11 
  336.             Caption         =   "Result:"
  337.             Height          =   255
  338.             Left            =   4080
  339.             TabIndex        =   34
  340.             Top             =   240
  341.             Width           =   615
  342.          End
  343.          Begin VB.Label Label10 
  344.             Caption         =   "Time 2:"
  345.             Height          =   255
  346.             Left            =   1800
  347.             TabIndex        =   33
  348.             Top             =   240
  349.             Width           =   615
  350.          End
  351.          Begin VB.Label Label9 
  352.             Caption         =   "Time 1:"
  353.             Height          =   255
  354.             Left            =   120
  355.             TabIndex        =   32
  356.             Top             =   240
  357.             Width           =   615
  358.          End
  359.       End
  360.    End
  361.    Begin SNAILTIMECALCLibCtl.SNTimeCalc SNTimeCalc1 
  362.       Left            =   6120
  363.       OleObjectBlob   =   "Form1.frx":0000
  364.       Top             =   0
  365.    End
  366. Attribute VB_Name = "Form1"
  367. Attribute VB_GlobalNameSpace = False
  368. Attribute VB_Creatable = False
  369. Attribute VB_PredeclaredId = True
  370. Attribute VB_Exposed = False
  371. Private Sub cmdDateMeth1_Click()
  372. cmdDateMeth1.Enabled = False
  373. picDateMeth1.Enabled = True
  374. picDateMeth1.Visible = True
  375. cmdTimeMeth1.Enabled = True
  376. picTimeMeth1.Enabled = False
  377. picTimeMeth1.Visible = False
  378. End Sub
  379. Private Sub cmdDatePlusDays_Click()
  380. On Error GoTo cmdDatePlusDays_Click_Err
  381.     txtResultDateForDatePlusDays.Text = SNTimeCalc1.DatePlusDays(txtDateForDatePlusDays.Text, txtDaysForDatePlusDays.Text)
  382.     Exit Sub
  383. cmdDatePlusDays_Click_Err:
  384. MsgBox Err.Description
  385. End Sub
  386. Private Sub cmdDayOfWeek_Click()
  387. On Error GoTo cmdDayOfWeek_Click_Err
  388.     txtDayOfWeekNumber.Text = SNTimeCalc1.DayOfWeek(txtDateForDayOfWeek.Text)
  389.     txtDayOfWeekVerbose.Text = DayOfWeekString(CInt(txtDayOfWeekNumber.Text))
  390.     Exit Sub
  391. cmdDayOfWeek_Click_Err:
  392. MsgBox Err.Description
  393. End Sub
  394. Private Sub cmdDaysBetweenDates_Click()
  395. On Error GoTo cmdDaysBetweenDates_Click_Err
  396.     txtResultDays.Text = SNTimeCalc1.DaysBetweenDates(txtDateForDaysBetweenDays1.Text, txtDateForDaysBetweenDays2.Text)
  397.     Exit Sub
  398. cmdDaysBetweenDates_Click_Err:
  399. MsgBox Err.Description
  400. End Sub
  401. Private Sub cmdTimeMeth1_Click()
  402. cmdDateMeth1.Enabled = True
  403. picDateMeth1.Enabled = False
  404. picDateMeth1.Visible = False
  405. cmdTimeMeth1.Enabled = False
  406. picTimeMeth1.Enabled = True
  407. picTimeMeth1.Visible = True
  408. End Sub
  409. Private Sub cmdTimeMinusTime_Click()
  410. On Error GoTo cmdTimeMinusTime_Click_Err
  411.     txtTimeMinusTimeResult.Text = SNTimeCalc1.TimeMinusTime(txtTimeForTimeMinusTime1.Text, txtTimeForTimeMinusTime2.Text)
  412.     Exit Sub
  413. cmdTimeMinusTime_Click_Err:
  414. MsgBox Err.Description
  415. End Sub
  416. Private Sub cmdTimePlusTime_Click()
  417. On Error GoTo cmdTimePlusTime_Click_Err
  418.     txtTimePlusTimeResult.Text = SNTimeCalc1.TimePlusTime(txtTimeForTimePlusTime1.Text, txtTimeForTimePlusTime2.Text)
  419.     Exit Sub
  420. cmdTimePlusTime_Click_Err:
  421. MsgBox Err.Description
  422. End Sub
  423. Private Sub Form_Load()
  424. 'Initialize windows
  425. cmdDateMeth1.Enabled = False
  426. picDateMeth1.Enabled = True
  427. picDateMeth1.Visible = True
  428. cmdTimeMeth1.Enabled = True
  429. picTimeMeth1.Enabled = False
  430. picTimeMeth1.Visible = False
  431. 'Initialize fields
  432. 'DatePlusDays
  433. txtDateForDatePlusDays.Text = Date
  434. txtDaysForDatePlusDays.Text = "0"
  435. txtResultDateForDatePlusDays.Text = SNTimeCalc1.DatePlusDays(txtDateForDatePlusDays.Text, txtDaysForDatePlusDays.Text)
  436. 'DaysBetweenDates
  437. txtDateForDaysBetweenDays1.Text = Date
  438. txtDateForDaysBetweenDays2.Text = Date
  439. txtResultDays.Text = SNTimeCalc1.DaysBetweenDates(txtDateForDaysBetweenDays1.Text, txtDateForDaysBetweenDays2.Text)
  440. 'Day of week
  441. txtDateForDayOfWeek.Text = Date
  442. txtDayOfWeekNumber.Text = SNTimeCalc1.DayOfWeek(txtDateForDayOfWeek.Text)
  443. txtDayOfWeekVerbose.Text = DayOfWeekString(CInt(txtDayOfWeekNumber.Text))
  444. 'TimePlusTime
  445. txtTimeForTimePlusTime1.Text = Time
  446. txtTimeForTimePlusTime2.Text = Time
  447. txtTimePlusTimeResult.Text = SNTimeCalc1.TimePlusTime(txtTimeForTimePlusTime1.Text, txtTimeForTimePlusTime2.Text)
  448. 'TimeMinusTime
  449. txtTimeForTimeMinusTime1.Text = Time
  450. txtTimeForTimeMinusTime2.Text = Time
  451. txtTimeMinusTimeResult.Text = SNTimeCalc1.TimeMinusTime(txtTimeForTimeMinusTime1.Text, txtTimeForTimeMinusTime2.Text)
  452. End Sub
  453. Private Function DayOfWeekString(nDayOfWeek As Integer) As String
  454. Select Case nDayOfWeek
  455.     Case 0
  456.         DayOfWeekString = "Sunday"
  457.     Case 1
  458.         DayOfWeekString = "Monday"
  459.     Case 2
  460.         DayOfWeekString = "Tuesday"
  461.     Case 3
  462.         DayOfWeekString = "Wednesday"
  463.     Case 4
  464.         DayOfWeekString = "Thursday"
  465.     Case 5
  466.         DayOfWeekString = "Friday"
  467.     Case 6
  468.         DayOfWeekString = "Saturday"
  469. End Select
  470. End Function
  471.